<?PHP
require_once("./include/membersite_config.php");
require_once("config.php");

$o = new stdClass();

if(!$fgmembersite->CheckLogin())
{
	echo "null";

	exit;
}
$user = $fgmembersite->UserFullName();


$filename = filter_input("INPUT_GET", 'filename');

if($Tables->checkListFileExtensions($filename))
{
$source = file_get_contents('php://input');
$name = $_GET['filename'];
$url = "$uploadDir"."/".$name;
$Tables->insertNewFile($name, $user);
$Tables->insertNewFileInFilesystem($name, $user);

        file_put_contents($url, $source);

        $o->url = $url;
}
 else {
    $o->errno = "Erreur pas de fichier valable";
}
echo $o;
?>